home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d3 / clarion.arc / TCPT.HLP (.txt) < prev    next >
Clarion Help  |  1991-07-24  |  24KB  |  581 lines

  1. Compiler Errors
  2.  E @15/30:  '.' WAS NOT EXPECTED HERE
  3.  E @20/5:
  4. 'ALERS' IS NOT A PROCEDURE
  5.  E @27/5:
  6. 'OR' IS INVALID IN THIS EXPRESSION
  7.  E @27/5:
  8. 'OR' - OPERATOR CANNOT BEGIN A STATEMENT
  9. Press Esc to correct errors
  10. Press Enter to continue
  11. The CLARION Compiler
  12.   Source File:C:\PHONES\PHONES.CLA
  13.   Listing
  14. Yes  No
  15.  This is the Compiler tutorial.  It should be 
  16.  viewed after the Designer tutorial.
  17.  The Designer tutorial generated the source
  18.  code for a phone directory application into  
  19.  seven modules: PHONES.CLA and PHONES1.CLA
  20.  through PHONES6.CLA.
  21.  PHONES.CLA is a program module.  It contains 
  22.  a MAP structure that names the other source  
  23.  modules in the application.
  24.  A program module also contains the global
  25.  data for an application.  Global data can be 
  26.  used by any procedure in any module.  In our 
  27.  application, the PHONEBK file is global.
  28.  PHONES1.CLA through PHONES6.CLA are member
  29.  modules.  Member modules contain procedures  
  30.  and functions that can use data declared in  
  31.  a program module.
  32.  Data declared in a member module can be used 
  33.  only by its own procedure or function.
  34.  This is Compiler's base window.  The Source
  35.  File field has been filled in for us with the 
  36.  name of the program module generated for the  
  37.  PHONES application (PHONES.CLA).
  38.  We will compile this module and we will 
  39.  request a listing.  The listing will be 
  40.  written to a file named PHONES.LST.
  41.  Using Editor, we have introduced errors 
  42.  into PHONES1.CLA.  Let's compile it
  43.  and see what happens.
  44.  This is the Compiler Errors window.  To correct
  45.  the errors, press the Esc key.  Editor will then  
  46.  be executed.  Editor will load the module, scroll 
  47.  to the first error, and display an error message. 
  48.  But we are getting ahead of ourselves.
  49.  This completes the Compiler tutorial.  The 
  50.  Processor tutorial should be viewed next.  
  51. The CLARION Debugger
  52.   Stopped for:Ctrl-Break
  53.   Stopped at :PHONES2/GET_PHONE/34
  54.      (Ctrl-S for Source) 
  55.   Called from:PHONES1/SHOW_PHONES/78
  56. (Ctrl-F for Source) 
  57.   Memory left:118K
  58. (Ctrl-X to execute) 
  59.   Trace
  60. DISPLAY
  61. DUMP  
  62.   Jump to :
  63. (26 thru 63)
  64.   Break at:
  65.   Variables
  66. Press Ctrl-Enter to resume or Ctrl-Break to exit
  67. Press Ctrl-P to peek then any key to debug
  68.  This is the Clarion Debugger window. 
  69.  The top section of the window gives  
  70.  the current program status.
  71.  The program was stopped because we  
  72.  pressed Ctrl_Break.  A program will 
  73.  also stop for a STOP statement in
  74.  the program or a break point set by 
  75.  the Debugger window.
  76.  When we pressed Ctrl-Break, the program was
  77.  executing statement number 34 in the GET_PHONE  
  78.  procedure.  GET_PHONE was called from statement 
  79.  number 78 in the SHOW_PHONE procedure.  There
  80.  was 118K of memory that was not being used.
  81.  Let's press Ctrl-S to see where the program
  82.  stopped.
  83.  We can trace a program by recording every statement 
  84.  number that was executed.  STEP displays this trace 
  85.  window every time the program branches.  DISPLAY
  86.  displays the trace window each time it fills with
  87.  statement numbers.  And DUMP writes the statement
  88.  numbers to a disk file.
  89.  We can "jump" to a different statement in GET_PHONE 
  90.  by entering a statement number and resuming program 
  91.  execution.  (Statement numbers 26 thru 63 are the
  92.  only executable statements in GET_PHONE.)  And we
  93.  can set break points at any statement number in any 
  94.  procedure.
  95.  We can watch or set the value of variables.  
  96.  Just enter a variable name and, optionally;  
  97.  a new value.
  98.  The Debugger remembers your watch variables  
  99.  and displays them every step or break point. 
  100.  Pressing Ctrl-Break from the Debugger terminates 
  101.  the program.  Ctrl-P temporarily removes the
  102.  Debugger window so you can see "behind" it.  The 
  103.  next keystroke restores the Debugger window.
  104.  We will press Ctrl-Enter to resume the program.  
  105.  This completes the Processor Tutorial.
  106.  The Translator tutorial should be viewed next. 
  107. Update Directory
  108.   Name
  109.   Address
  110.   City State:
  111.   Zip
  112.   Telephone :
  113. Update Directory
  114.   Name
  115. :Kemp, Kim
  116.   Address
  117. :56 Plum Ave
  118.   City State:Miami, Fl
  119.   Zip
  120. :33050
  121.   Telephone :491-5856
  122.  There is nothing in our PHONEBK file, so 
  123.  PHONES "pops up" the form window for us  
  124.  to make the first entry.
  125. Phone Directory
  126. Update Directory
  127. Print Directory
  128.      Quit
  129.  This is the menu screen we designed. 
  130.  The up and down arrow keys move the  
  131.  selector bar.  (So do the "U", "P"
  132.  and "Q" keys.)
  133.  This is what we get if we press F1 (Help). 
  134.  Let's take a look at "Update Directory". 
  135.   29 LOOP
  136.  )!LOOP THRU AL
  137. ALERT
  138.  &!TURN OFF THE
  139. ALERT(ACCEPT_KEY)
  140. !ALERT ON SCR
  141. ALERT(REJECT_KEY)
  142. !ALERT ON SCR
  143. ACCEPT
  144.  %!GET THE NEXT
  145. IF KEYCODE() = REJECT_KEY THEN RETURN.
  146. !RETURN ON SC
  147. EDIT_RANGE# = FIELD
  148. !SET ONE FIEL
  149. IF KEYCODE() = ACCEPT_KEY
  150. !ON SCREEN AC
  151. UPDATE
  152.  #!  MOVE FIELD
  153. EDIT_RANGE# = ?LAST_FIELD
  154. AND EDIT
  155. LOOP FIELD# = FIELD() TO EDIT_RANGE#
  156. !EDIT FIELDS 
  157. CASE FIELD#
  158. !JUMP TO FIEL
  159. OF ?FIRST_FIELD
  160. !FROM THE FIR
  161. IF KEY_CODE() = ESC_KEY THEN RETURN.
  162. !  RETURN ON 
  163. OF ?PHN:NAME
  164. !Name
  165. OF ?PHN:ADDRESS
  166. !Address
  167. OF ?PHN:CITY_STATE
  168. !City and Sta
  169. OF ?PHN:ZIP
  170. !Zip Code
  171. OF ?PHN:PHONE
  172. !Telephone Nu
  173.  !!LOOP THRU ALL THE FIELDS
  174.  !!TURN OFF THE ALERT KEYS
  175. PT_KEY)
  176. !ALERT ON SCREEN ACCEPT
  177. CT_KEY)
  178. !ALERT ON SCREEN REJECT
  179.  !!GET THE NEXT FIELD
  180. () = REJECT_KEY THEN RETURN.
  181. !RETURN ON SCREEN REJECT KEY  
  182. # = FIELD
  183. !SET ONE FIELD EDIT RANGE
  184. () = ACCEPT_KEY
  185. !ON SCREEN ACCEPT
  186.  !!  MOVE FIELDS FROM SCREEN
  187. GE# = ?LAST_FIELD
  188. AND EDIT THE REST OF THEM
  189.  To see more source code, we can
  190.  scroll forward with the PgDn key. 
  191.  Or backward with the PgUp key. 
  192.  We can scroll horizontally to the 
  193.  right with the End key.
  194.  And back to the left with the Home key. 
  195.  We press Esc to remove the source window. 
  196. The CLARION Processor
  197.   Program:C:\PHONES\PHONES.PRO
  198.  This is the the Processor tutorial.  It should 
  199.  be viewed after the Compiler tutorial.
  200.  The Compiler tutorial compiled source programs 
  201.  generated by the Designer tutorial.  Compiler  
  202.  produces a processor module for each source
  203.  module it compiles.  For PHONES, the Compiler  
  204.  tutorial produced PHONES.PRO and PHONES1.PRO
  205.  through PHONES6.PRO.
  206.  The processor modules contain Clarion pseudo  
  207.  code--the language of an imaginary Clarion
  208.  computer.
  209.  Processor loads all the processor modules for 
  210.  a program and executes them.  The benefits of 
  211.  using the Processor are testing without
  212.  linking and interpretive debugging.
  213.  This is the Processor's base window.
  214.  If Processor were invoked by Shift-F7 or  Shift-F8, 
  215.  it would start execution without stopping here.
  216.  To test PHONES, we press the Enter key.
  217.  SCLARION CROSS REFERENCE v2.0 :PHONES.PRO
  218. 12/02/87 10:55AM
  219.  VGLOBAL STRUCTURES AND VARIABLES
  220.  $PAGE  1
  221.  VPRE  LABEL
  222.      SIZE LINE REFERENCES
  223.  VPHN: ADDRESS
  224. STRING
  225. 36 PHONES3
  226. PHN: CITY_STATE
  227. STRING
  228. 37 PHONES3
  229. PHN: NAME
  230.      STRING
  231. 35 PHONES
  232.  CPHONES2
  233.  CPHONES3
  234. PHN: NAME_KEY
  235. 33 PHONES2
  236. 49  53  75  80  89  92
  237.  /PHONES3
  238. PHN: PHONE
  239. DECIMAL
  240. 39 PHONES2
  241.  CPHONES3
  242. PHONEBK
  243. 32 PHONES
  244.  CPHONES2
  245. 34  47  48  55  79  87
  246.  >88  93  94
  247. PHN: RECORD
  248. RECORD
  249. 34 PHONES
  250.  CPHONES2
  251. 43  60  83
  252. PHN: ZIP
  253. 38 PHONES3
  254.  SCLARION CROSS REFERENCE v2.0 :PHONES.PRO
  255. 12/02/87 10:55AM
  256.  VPROCEDURES AND FUNCTIONS
  257.  +PAGE  2
  258.  VLABEL
  259. MODULE
  260. LINE  REFERENCES
  261.  VCHECK_PHONES PROCEDURE
  262. PHONES4
  263. 2  PHONES
  264.  DPHONES1
  265. GET_PHONE
  266. PROCEDURE
  267. PHONES3
  268. 2  PHONES
  269.  DPHONES2
  270. 44  76  84
  271.      PROCEDURE
  272. PHONES1
  273. 2  PHONES
  274. 13  46
  275. PHONES
  276. PROCEDURE
  277. PHONES
  278. PRINT_PHONES PROCEDURE
  279. PHONES5
  280. 2  PHONES
  281.  DPHONES4
  282. SCROLL_SCR
  283. PROCEDURE
  284. PHONES6
  285. 2  PHONES
  286.  DPHONES2
  287. 50  96
  288. SHOW_PHONES  PROCEDURE
  289. PHONES2
  290. 2  PHONES
  291.  DPHONES1
  292.  This is the first section of the cross-reference 
  293.  listing for PHONES.  It lists global structures  
  294.  and variables in alphabetical order.  the only
  295.  global data in PHONES is the PHONEBK file.  The  
  296.  "REFERENCES" are modules and line numbers where  
  297.  the labels are used.
  298.  This section of the cross-reference shows all 
  299.  the procedures and functions in the program-- 
  300.  where they occur and where they are called.
  301.  This completes the Crossrefer tutorial. 
  302.  Let's return to the tutorial menu.
  303. The CLARION Compiler
  304. Stream Compilation Request
  305.   Program
  306. :PHONES.PRO
  307.   Listings
  308. Yes  No
  309.   Conditional:Yes
  310. Yes  No
  311.      NO MESSAGES FOUND IN PHONES.CLA
  312.  After compiling a program module, Compiler offers to  
  313.  compile all member modules.  This process is called
  314.  stream compilation.  Stream compilation is a fast way 
  315.  to compile modules for the first time or whenever
  316.  global data in a program module is changed.
  317.  A conditional stream compilation compiles all  
  318.  member modules if the global data has changed. 
  319.  Otherwise, it only compiles the member modules 
  320.  that have been changed.
  321.  We will request a conditional stream 
  322.  compilation with listings.
  323.  Our PHONES application is now compiled and ready for testing.  
  324.  Of course there were no errors--Designer is a fine programmer. 
  325.  If Compiler were executed by Shift-F7 (compile and test),
  326.  Processor would load and execute without stopping here.
  327.  But let's see what happens when Compiler finds errors. 
  328. Stream Compilation Summary
  329. NO MESSAGES FOUND IN PHONES.CLA
  330. 4 MESSAGES FOUND IN PHONES1.CLA
  331. NO MESSAGES FOUND IN PHONES2.CLA
  332. NO MESSAGES FOUND IN PHONES3.CLA
  333. NO MESSAGES FOUND IN PHONES4.CLA
  334. NO MESSAGES FOUND IN PHONES5.CLA
  335. NO MESSAGES FOUND IN PHONES6.CLA
  336. Press Esc to correct errors
  337. Press Enter to continue
  338. RPHONES6.CLA
  339. End of compile
  340. 154k Available memory 
  341.  Ahlstrom, Kim
  342. 482-4766  Barrington, Bruce
  343. 784-6822  Cohen, Rob
  344. 491-5479  Dyer, Jackie
  345. 793-5847  Frankel, Allyn
  346. 791-5833  Garneau, Bob
  347. 492-5441  Garrett, Tom
  348. 395-8774  Hammond, Brian
  349. 782-8221  Herron, John
  350. 495-2876  Jackson, Tony
  351. 394-6887  Johnson, Don
  352. 493-5877  Kemp, Kim
  353. 491-5856  Kemp, Steve
  354. 468-2588  Kohler, Sue
  355. 941-5875  Lavella, Jim
  356. 941-5766  Liming, Gary
  357. 783-5113 
  358. Phone Directory
  359.  Herron, John
  360. 495-2876  Jackson, Tony
  361. 394-6887  Johnson, Don
  362. 493-5877  Kemp, Kim
  363. 491-5856  Kemp, Steve
  364. 468-2588  Kohler, Sue
  365. 941-5875  Lavella, Jim
  366. 941-5766  Liming, Gary
  367. 783-5113  Maibach, Tom
  368. 492-7536  Mitchell, Steve
  369. 395-2114  Nicholson, Ron
  370. 946-2117  Packer, Colvin
  371. 693-5874  Shaw, Monty
  372. 791-6587  Smith, LeAnn
  373. 492-5788  Steinke, Bob
  374. 395-2877  Wood, Dotti
  375. 782-5877 
  376. Phone Directory
  377. Ahlstrom, Kim
  378. 482-4766
  379. Barrington, Bruce
  380. 784-6822
  381. Cohen, Rob
  382. 491-5479
  383. Dyer, Jackie
  384. 793-5847
  385. Frankel, Allyn
  386. 791-5833
  387. Garneau, Bob
  388. 492-5441
  389. Garrett, Tom
  390. 395-8774
  391. Hammond, Brian
  392. 782-8221
  393. Herron, John
  394. 495-2876
  395. Jackson, Tony
  396. 394-6887
  397. Johnson, Don
  398. 493-5877
  399. Kemp, Kim
  400. 491-5856
  401. Kemp, Steve
  402. 468-2588
  403. Kohler, Sue
  404. 941-5875
  405. LeAnn Smith
  406. 941-5766
  407. Liming, Gary
  408. 783-5113
  409.  Now our phone directory has an entry in it.  
  410.  After we add a few more, it looks like this. 
  411.  The up and down arrow keys 
  412.  move the selector bar.
  413.  From the bottom, down arrow 
  414.  scrolls the whole table up. 
  415.  Ctrl-PgDn scrolls to the 
  416.  end of the directory.
  417.  And Ctrl-PgUp scrolls back 
  418.  back to the beginning.
  419.  To change an entry, select  
  420.  it and press the Enter key. 
  421.  To add a new entry, 
  422.  press the Ins key.  
  423.  And to delete an entry, 
  424.  press the Del key.
  425.  That's how our phone directory works--not bad for 
  426.  15 minutes worth of design and no programming.
  427.  Now let's take a look at the Processor's Debugger 
  428.  window.  We will bring up the update window (with 
  429.  Enter) and then press Ctrl-Break.
  430. The CLARION Translator
  431.  Program
  432. :C:\CLARION\PHONES.PRO
  433.  Create ARF  :No
  434.      RTLink  Link  Plink86  No
  435.  ARF Filename:
  436.  ARF Switches:
  437.  Use RTL File:No
  438.      Yes  No
  439.  RTL Name
  440.  Run Linker  :No
  441.      Yes  No
  442.  Linker Name :
  443.  Line Numbers:No
  444.      Yes  No
  445.  ;294k Available memory
  446.  This is the Translator tutorial.  It should be
  447.  viewed after the Processor tutorial.
  448.  The Compiler tutorial compiled the source program  
  449.  generated by the Designer tutorial.  The Processor 
  450.  tutorial then tested that program by executing the 
  451.  .PRO modules produced by the Compiler.
  452.  Translator reads each .PRO module for a program 
  453.  and creates a standard .OBJ module.
  454.  Translator then produces an automatic response  
  455.  file (ARF) for either LINK or PLINK.  (PLINK is 
  456.  the brand name of a linker utility copyrighted  
  457.  by Phoenix Software Associates, LTD.)
  458.  If requested, Translator executes LINK or PLINK 
  459.  and produces a .EXE file which can be executed  
  460.  from the DOS command line.
  461.  This is Translator's base window.  
  462.  The options entered here are saved 
  463.  in a file named PHONES.TRN.  When  
  464.  Translator is invoked by Shift-F9, 
  465.  it uses the existing .TRN file and 
  466.  begins translating modules without 
  467.  stopping for operator entry.
  468.  When the program is entered, the .TRN file is
  469.  read and the options are displayed.
  470.  This is the first translation for PHONES, so it 
  471.  has no .TRN file.  These are default options.
  472.  An Automatic Response File (ARF) is a text file which can be used to tell the
  473.  linker the information it needs in order to link your program.  Among other  
  474.  things, the ARF tells the linker the names of all of the modules that make
  475.  up a program.  Translator supports three styles of ARF -- Rtlink, Link, and  
  476.  Plink86.  We will use a Link-style ARF.
  477.  If we had chosen to use RtLink, we would be given the option useing an RTL or
  478.  Run Time Library.  Using this option will save disk space because multiple
  479.  executable files can use the same RTL.
  480.  We will accept PHONES.ARF as a filename.
  481.  And, this time, we don't need special Link switches.
  482.  We want to run the linker.
  483.  It is in the \DOS directory.
  484.  And we don't want line numbers. 
  485.  Microsoft Link is running now.  It runs a long 
  486.  time--that's why we use Processor for testing. 
  487.  But let's not wait it out. Here's what happens 
  488.  when it finishes.
  489.  We have just created a .EXE file for PHONES.  This file can now 
  490.  be distributed without royalties and the end-user does not need 
  491.  to purchase a copy of Clarion.
  492.  This completes the Translator tutorial and the tutorial series. 
  493.  Any remaining tutorial can be viewed next.
  494. The CLARION Crossrefer
  495.   Program:C:\PHONES\PHONES.PRO
  496.  This is the Crossrefer Tutorial.
  497.  Crossrefer builds a cross-reference listing of the 
  498.  global data in a program.  The listing shows where 
  499.  a label is declared and every place it is used.
  500.  This is Crossrefer's base window.  To build a  
  501.  a cross-reference listing for PHONES, we press 
  502.  the Enter key.
  503.  The cross-reference listing is now
  504.  contained in a file named PHONES.XRF. 
  505. CERR    
  506. CMP     
  507. CMP_W1  
  508. CMP_W2  -
  509. CMP_W3  
  510. CMP_W4  
  511. CMP_W5  
  512. CMP_W6  O    
  513. CMP_W7  
  514. CMP_W8  
  515. DBUG    
  516. DBUG_W1 
  517. DBUG_W2 \
  518. DBUG_W3 ;
  519. DBUG_W4 
  520. DBUG_W5 
  521. DBUG_W6 G
  522. DBUG_W7 G
  523. DBUG_W8 y
  524. FORM_ADD
  525. FORM_UPD
  526. FORM_W1 
  527. MENU    j
  528. MENU_W1 
  529. MENU_W2 Q
  530. MENU_W3 
  531. PGM1    
  532. PGM2    g
  533. PGM3    
  534. PGM_W1  
  535. PGM_W2  
  536. PGM_W3  
  537. PGM_W4  3%
  538. PGM_W5  
  539. PRO     
  540. PRO_W1  D'
  541. PRO_W2  
  542. PRO_W3  ?*
  543. RPT1    5+
  544. RPT2    
  545. RPT_W1  
  546. RPT_W2  
  547. RPT_W3  
  548. SCMP    03
  549. SCMP_W1 (5
  550. SCMP_W2 e6
  551. SCMP_W3 A7
  552. SCMP_W4 
  553. SCMP_W5 
  554. SERR    29
  555. TBL_BGN 
  556. TBL_EMPT
  557. TBL_END 
  558. TBL_FULL
  559. TBL_W1  
  560. TBL_W2  
  561. TBL_W3  
  562. TBL_W4  SF
  563. TBL_W5  
  564. TBL_W6  
  565. TBL_W7  kG
  566. TBL_W8  
  567. TBL_W9  
  568. TRN     :I
  569. TRN_W1  ,M
  570. TRN_W2  
  571. TRN_W3  eP
  572. TRN_W4  
  573. TRN_W5  
  574. TRN_W6  jU
  575. TRN_W7  
  576. TRN_W8  
  577. XRF     (X
  578. XRF_W1  
  579. XRF_W2  
  580. XRF_W3  I[
  581.